﻿using Domain.Entitys.Base_Manage;
using Domain.IRepositorys.Base_Manage;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCore.Repositorys.Base_Manage
{
    public class DictRepository : IDictRepository
    {
        private readonly MyDbContext myDbContext;

        public DictRepository(MyDbContext myDbContext)
        {
            this.myDbContext = myDbContext;
        }

        /// <summary>
        /// 根据字典类型查询字典数据
        /// </summary>
        /// <param name="dict_type"></param>
        /// <returns></returns>
        public List<Sys_Dict_Data> Get_Dict_Datas(string dict_type)
        {
            return myDbContext.Sys_Dict_Data.Where(dd => dd.Status == '0' && dd.Dict_type == dict_type).OrderBy(dd => dd.Dict_sort).ToList();
        }
    }
}
